<template>
  <div id="app">
    <div v-if="isshow">
      <button @click="hanleedit">点击显示</button>
    </div>
    <div v-else><input ref="inp" type="text" /><span>编辑</span></div>
  </div>
</template>
<script >
export default {
  name: "app4",
  data() {
    return {
      isshow: true,
    };
  },
  props: [],
  components: {},
  created() {},
  mounted() {},
  methods: {
    hanleedit() {
      this.isshow = false;
      this.$nextTick(() => {
        console.log(this.$refs.inp);
        this.$refs.inp.focus();
      });
    },
  },
};
</script>
<style lang='less' scoped>
</style>